using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ShowPdfFile
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: If using PDFduo Full Version, put your License Code below.
            // Otherwise, if you are using PDFduo Trial, comment out the 
            // following line (Free version doesn't have LicenseCode method). 
            // DuoDimension.HtmlToPdf.SetLicenseCode("YOUR-LICENSE-CODE-HERE");

            string file_html = @"K:\hdoc.html";
            string file_pdf = @"K:\new.pdf";

            try
            {
                DuoDimension.HtmlToPdf conv = new DuoDimension.HtmlToPdf();
                conv.OpenHTML(file_html);
                conv.SavePDF(file_pdf);
                conv.ShowPDF(file_pdf);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Close();
        }
    }
}